#set($title = "智能会议预定系统-管理员-top")
<div class="container">
    <div class="row">
        <div id="graphic" class="span12">
            <div id="mainChart" style="height:400px">
            </div>
			<div id="mainUserChart" style="height:400px">
            </div>
			
        </div>
        <!--/span-->
    </div>
    <!--/row-->
    #includeJs(["esl/esl"])
    #includeEcharts
    <script type="text/javascript">
                        
                        var option = {
                            tooltip : {
                                trigger: 'axis'
                            },
                            legend: {
                                data:['使用时间']
                            },
                            toolbox: {
                                show : true,
                                feature : {
                                    mark : true,
                                    dataView : {readOnly: false},
                                    magicType:['line', 'bar'],
                                    restore : true,
                                    saveAsImage : true
                                }
                            },
                            calculable : true,
                            xAxis : [
                                {
                                    type : 'category',
                					
                                    data : [#foreach($top in $tops)'$meetingTool.getMeetingName($top.meetingId)',#end]
                                }
                            ],
                            yAxis : [
                                {
                                    type : 'value',
                                    splitArea : {show : true}
                                }
                            ],
                            series : [
                                {
                                    name:'使用时间',
                                    type:'bar',
                                    data:[#foreach($top in $tops)'$top.amount',#end]
                                }
                            ]
                        };
                          var optionUser = {
                            tooltip : {
                                trigger: 'axis'
                            },
                            legend: {
                                data:['使用时间']
                            },
                            toolbox: {
                                show : true,
                                feature : {
                                    mark : true,
                                    dataView : {readOnly: false},
                                    magicType:['line', 'bar'],
                                    restore : true,
                                    saveAsImage : true
                                }
                            },
                            calculable : true,
                            xAxis : [
                                {
                                    type : 'category',
                					
                                    data : [#foreach($top in $topUsers)'$userTool.getUser($top.userId).getUserName()',#end]
                                }
                            ],
                            yAxis : [
                                {
                                    type : 'value',
                                    splitArea : {show : true}
                                }
                            ],
                            series : [
                                {
                                    name:'使用时间',
                                    type:'bar',
                                    data:[#foreach($top in $topUsers)'$top.amount',#end]
                                }
                            ]
                        };
                        require(
                            [
                                'echarts',
                                'echarts/chart/line',
                                'echarts/chart/bar'
                            ],
                            function(ec) {
                                var myChart = ec.init(document.getElementById('mainChart'));
                                myChart.setOption(option);
								var myChartUser = ec.init(document.getElementById('mainUserChart'));
                                myChartUser.setOption(optionUser);
                            }
                        )
                    
            
    </script>
